Partial Public Class pages_customers_usercontrols_UCCustomer : Inherits UserControl

#Region "Interface"
    Public Sub Display(ByVal [customer] As CCustomer, page as CCustomerList, pi As CPagingInfo)
        If Parent.Controls.Count Mod 2 = 0 Then row.Attributes.Add("class", "alt_row")

        With [customer]
            litNumber.Text = CStr(page.IndexOf([customer]) + 1 + pi.PageIndex * pi.PageSize)
            lnkCustomerEmail.Text = .CustomerEmail
            lnkCustomerEmail.NavigateUrl = "mailto:" & .CustomerEmail
            lnkCustomerName.Text = CStr(IIF(.CustomerName.Length = 0, "...", .CustomerName))
            lnkCustomerName.NavigateUrl = CSitemap.Customer(.CustomerId)
            'chkCustomerSendMeNewsletter.Checked = .CustomerSendMeNewsletter

            lnkOrders.Text = CUtilities.CountSummary(.OrdersCount, "orders", "none")
            lnkOrders.NavigateUrl = CSitemap.OrdersForCustomer(.CustomerId)

            lnkOrders.ToolTip = CUtilities.ListToString(.Orders.ProductNamesAndPrices, vbCrLf)

            'lnkReminders.Text = CUtilities.CountSummary(.RemindersCount, "email", "none")
            'lnkReminders.NavigateUrl = CSitemap.RemindersForCustomer(.CustomerId)

            If .TotalSales > 0 Then
                lnkSalesTotal.Text = CTextbox.SetMoney(.TotalSales)
                If .TotalPaid > 0 Then
                    lnkSalesPaid.Text = CTextbox.SetMoney(.TotalPaid)
                    litConversion.Text = CTextbox.SetPercent(100.0 * .TotalPaid / .TotalSales, "n0")
                ElseIf .PaidAmount > 0 Then
                    lnkSalesPaid.Text = CTextbox.SetMoney(.PaidAmount)
                    litConversion.Text = CTextbox.SetPercent(100.0 * .PaidAmount / .TotalSales, "n0")
                End If
            End If

            litPaidAmount.Text = CTextbox.SetMoney(.PaidAmount)
            litPaidNet.Text = CTextbox.SetMoney(.PaidNet)

            lnkPayments.Text = CUtilities.CountSummary(.PaymentCount, "payment", "&nbsp;")
            lnkPayments.NavigateUrl = CSitemap.PaymentsForCustomer(.CustomerId)
        End With
    End Sub
#End Region

End Class

